<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib  prefix="fck" uri="http://java.fckeditor.net"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>发布新闻 </title>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/script/lib/jquery-1.5.1.js"></script>
<script type="text/javascript">
$(function(){
	<% if(request.getAttribute("addMsg") != null){
		%>alert('<%=request.getAttribute("addMsg")%>')<%
	}
	%>
	
	//取新闻类型
	$.ajax({
        type: 'POST',
        url: 'getNewsTypes',
        dataType: 'json',
        success : function(data) {
        	 var types = eval('('+data+')');
		    	var obj = document.getElementById('newstype');;
			    for(var i=0;i<types.length;i++){
			    	var type = types[i];
			    	var opn = document.createElement("OPTION");
			        obj.appendChild(opn);
			        opn.innerHTML = type.typename;
			        opn.value = type.typeid;
			    }
		},
		error: function(data) { alert('获取新闻类型异常'); }
    });
	
});
function quitWin(){
	parent.ClosePop();
}
function submitForm(){
	//做表单的校验
}
</script>
</head>
<body>
	<div id="currentPossition" style="vertical-align: center">
		<table style="table-layout: fixed;" cellpadding="0" cellspacing="1" border="0">
		<tr><td><img width="7" height="7"  src="images/title/title-icon.gif" border="0" hspace="8" complete="complete"/></td>
		<td style="font-size: 9pt;">当前位置：新闻管理>业界新闻管理>发布新闻</td></tr></table>
	</div>
	<div align="left" style="border-color: #7f9db9;border-width: 1px;border-style: solid; margin-top: 6px;" >
		<div align="center" style="height:810px;width:100%;background-color:#f1f5ff;">
			<div align="left" style="height:25px;width:100%;background-color:#d5e2f2;font-size: 12px;vertical-align: ">
				<table style="vertical-align: middle;height: 100%;"><tr><td><img width="7" height="7"  src="images/title/title-icon.gif" border="0" hspace="8" complete="complete"/>增加新闻内容</td></tr></table>
			</div>
			<form action="addNews" onSubmit="return submitForm()">
				<table style="width: 100%;margin-top: 8px;">
					<tr >
						<td style="font-size: 12px;width:15%;" align="right"><font color="red"> 新闻标题：</font></td>
						<td style="width:75%;" align="left"><input type="text" name="newstitle" id="newstitle" value="" style="width: 100%" />
						</td>
						<td style="width:10%;" align="left"><font color="red" > <div id="nameMsg" style="margin-left: 5px;font-size: 12px;">*</div></font></td>
					</tr>
					<tr>
						<td style="font-size: 12px;width:15%;" align="right"><font color="red">新闻类型：</font></td>
						<td style="width:75%;" align="left">
						<!-- <input type="" name="newstype" id="newstype" value="" style="width: 100%" /> -->
						<select name="newstype" id="newstype"  style="width: 101%" >
						<option >请选择……</option>
						</select>
						</td>
						<td style="width:10%;" align="left"><font color="red"> <div id="typeMsg" style="margin-left: 5px;font-size: 12px;">*</div></font></td>
					</tr>
					<tr>
						<td style="font-size: 12px;width:15%;" align="right"><font color="red">新闻来源：</font></td>
						<td style="width:75%;" align="left">
						<input type="text" name="source" id="source" value="" style="width: 100%" />
						</td>
						<td style="width:10%;" align="left"><font color="red"> <div id="typeMsg" style="margin-left: 5px;font-size: 12px;">*</div></font></td>
					</tr>
					<tr>
						<td style="font-size: 12px;width:15%;" align="right"><font color="red">源网址：</font></td>
						<td style="width:75%;" align="left">
						<input type="text" name="link" id="link" value="" style="width: 100%" />
						</td>
						<td style="width:10%;" align="left"><font color="red"> <div id="typeMsg" style="margin-left: 5px;font-size: 12px;">*</div></font></td>
					</tr>
					<tr>
						<td style="font-size: 12px;width:15%;" align="right"><font color="red">文章内容：</font></td>
						<td style="width:75%;" align="left">
						</td>
						<td style="width:10%;" align="left"><font color="red"> <div id="typeMsg" style="margin-left: 5px;font-size: 12px;">*</div></font></td>
					</tr>
					<tr>
						<td style="font-size: 12px;width:15%" align="right"></td>
						<td style="width:75%;" align="left">
						<fck:editor instanceName="content" width="100%" height="600">
										
						</fck:editor></div></td>
						<td style="width:10%;" align="left"><font color="red"> <div id="typeMsg" style="margin-left: 5px;font-size: 12px;">*</div></font></td>
					</tr>
					
					<tr>
						<td style="height:10px;font-size: 12px;width:15%;" align="right" colspan="4"></td>
					</tr>
					<tr >
						<td></td>
						<td   style="height:22px;vertical-align: top;">
						<table style="width:100%"><tr><td style="width:10%" align="right">
						<input type="submit" value="保存" style="width: 60px; border-style: solid;border-width: 1px;border-color: #7f9db9;font-size: 9pt;background-color:#f1f5ff ;padding-top: 2px;" />
						</td><td align="right" style="width:10%">
						<input type="button" onclick="quitWin();" value="退出" style="width:60px; border-style: solid;border-width: 1px;border-color: #7f9db9;font-size: 9pt;background-color:#f1f5ff;padding-top: 2px; " />
						</td><td style="width:10%"></td><td style="width:10%"></td><td style="width:10%"></td></tr></table>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</body>
</html>